# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

decoded = b"""\
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut viverra neque in massa rutrum, non rutrum nunc pellentesque. Phasellus et nulla metus. Nam aliquet felis nec iaculis eleifend. Donec pretium tellus non aliquam tristique. Mauris feugiat eu velit sed maximus. Praesent fringilla lorem vel orci maximus accumsan. Fusce vel sapien ipsum. Nulla ac lectus non arcu semper laoreet.

Aliquam et massa at ex elementum dictum vitae ac purus. Sed a nunc sed dui pulvinar mollis eu sed eros. Mauris vitae ullamcorper dolor. Ut sed nisl sem. Mauris pulvinar vitae orci nec tincidunt. Integer fringilla quam in lobortis vehicula. In aliquam egestas dapibus. Suspendisse est enim, maximus non massa eget, finibus finibus lorem. Phasellus a varius ante. Pellentesque tempor dignissim nunc ut malesuada.

Ut rutrum massa vitae pellentesque lobortis. Vivamus gravida cursus venenatis. Sed metus lorem, commodo vitae pulvinar sagittis, scelerisque quis orci. Vivamus viverra lorem nibh, quis commodo orci luctus pulvinar. Morbi aliquam urna sed magna luctus, quis vulputate tellus pulvinar. Mauris congue velit sed volutpat sodales. Aenean faucibus sapien erat, ac vestibulum leo aliquam at. In magna lorem, hendrerit sed ultrices a, maximus a turpis. Sed sit amet magna eget velit luctus rutrum ac eu est. Donec tristique augue quis luctus auctor. Pellentesque eu mi viverra, lobortis orci et, semper justo. Nunc non viverra purus. Phasellus a purus id elit dictum ullamcorper at quis urna. Nullam semper porttitor diam, in feugiat mi imperdiet eget. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;

Fusce sed mattis ligula, non viverra ante. Proin viverra maximus enim, non facilisis ante rhoncus eget. Praesent molestie justo ac diam luctus aliquam. Nunc vitae justo posuere ex convallis varius. Suspendisse potenti. Vivamus elementum lacus vel tortor varius, ut blandit nisl laoreet. Suspendisse potenti. Proin gravida facilisis dui, id maximus est porttitor rhoncus.

Mauris ut quam purus. Cras maximus risus sit amet pretium facilisis. Vivamus ullamcorper arcu et est semper, nec malesuada metus interdum. Nulla tincidunt orci suscipit nisi congue aliquet. In ultrices pulvinar ipsum a egestas. Proin felis diam, malesuada vel suscipit quis, auctor vehicula augue. Vestibulum eget ipsum in neque volutpat aliquam porta ac augue.

Etiam tincidunt nulla at tellus sodales, sit amet facilisis elit maximus. Nulla et lorem aliquam arcu molestie suscipit. Donec convallis tellus nibh, vel vulputate velit ultrices luctus. Nam et diam sit amet dolor suscipit auctor. Nam blandit felis quis ex pretium consectetur. Etiam vitae ultrices arcu. Nullam et urna pellentesque, ornare mi mattis, fringilla dolor. Vestibulum augue tortor, imperdiet in porta nec, vestibulum a sem. Phasellus nec mattis eros. Maecenas tristique enim egestas libero laoreet posuere. Sed eros nunc, auctor a molestie egestas, dictum a ante. In hac habitasse platea dictumst. Nullam luctus aliquam pellentesque. Morbi non diam ligula. Proin vulputate tortor dui, ac lacinia nisi luctus at.

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec dignissim urna sed ligula semper, id mattis enim malesuada. Nullam ac magna et justo commodo viverra ac ac erat. Praesent mi mi, aliquet sit amet augue eu, blandit tempus nisi. Donec dapibus ex et sodales malesuada. Vivamus venenatis aliquet nunc, eget egestas ipsum. Nunc venenatis iaculis congue. Sed iaculis rhoncus diam, at rhoncus arcu imperdiet vel.

Suspendisse potenti. Praesent ut iaculis elit, a venenatis metus. Sed vitae neque ut neque vehicula placerat id eget erat. Aliquam erat volutpat. Sed dictum molestie nisi eget rhoncus. Nulla et laoreet nisl, a consectetur mauris. In ornare ut mauris quis scelerisque. Pellentesque ultrices nibh in lacus feugiat, id tempus lacus condimentum.

Aenean tincidunt consequat augue, in bibendum nisl placerat in. Nulla non dignissim est. Nam ac mauris eleifend, elementum ex in, luctus justo. Aliquam ac leo facilisis, elementum libero et, tristique lacus. Aliquam commodo elementum consequat. Vestibulum mollis, lacus a porttitor lacinia, est ipsum mollis ante, non cursus elit tortor eget lacus. Quisque suscipit quam massa, sit amet tempus nulla varius sed. Ut maximus velit quis nulla blandit mollis eu a libero. Aliquam sed dignissim elit. Vivamus quis erat vitae turpis tincidunt ultrices.

Nulla facilisis dui odio, at scelerisque erat cursus a. Ut arcu nunc, ullamcorper vitae orci eget, sollicitudin maximus sapien. Fusce eu arcu nunc. Integer vitae eros turpis. Fusce ac elit in nisi rutrum suscipit id consectetur lacus. Suspendisse rutrum ligula auctor fringilla cursus. Sed consequat erat in nunc lacinia, et ullamcorper velit vestibulum. Mauris sed est a tellus feugiat sagittis non nec neque. Sed eu bibendum orci. Donec diam diam, viverra sed dolor non, posuere sagittis mi. Duis rhoncus, risus sit amet luctus sodales, risus arcu faucibus enim, eu cras amet.\
"""

encoded = b'\x1b\x99\x13 ,\x0elw\x08\x95t\xd2\xe6\xf2(\xcd\'5M\x9dg\xd7\xc9)uG\xf4P\x8c;\x92_(\xb1\x14@L\x9d$\xa2\x16\x8f\x06\xc8\x18J\xed\xac\xabd_\xfb\xbe\xcb\xab\x90]VTu\xbc\xe1\xc3\x11\x96\x81T\r\xabj\x07\xbd\xe0\xb2\xd7y\x89\x1c\x81\xfd8\x9f\x15\xcf\xf8\xf6\xe6\x84\x8d\x90Ta<\xef\xcf\xce\xcc\x95\xa4\xff;\xcaO\xe9e\x97z/\xeap\t\x0e\x17\xd9\x14\xb6\xa9V\x151\n\xd0\xe0Fh\xd8\xbd\xd2\xdcB@\xed\xfa\xbe\xea\xb1V\xa1\xe7I\xd5\xfa\x7fTV\xa0\xa4\xda\x86G>R\x1a\x84\x1fs\x1b/\x98\xd6\xfa#\xaa_\xf5\xb7-\xf8d\x99\x80\x87O\xdb\xa1\xbe\xa9\x1a\xc3\xfb\xaf!\xc4f#oa\xc4\xffY?\x8f\xf3\xfc{\xe6\x1dB\x11\xe6\xdd\xe6(\\_S \xfd\xc9\x12\x9d4\t\x1cMO\x9a0u\xfd\t\xd7z\x1d\xe4l\'y\x17\x83\xbcCb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x12\xe8\x17\xe2\xcf\x9f\x9bm\xc3\xe5<\x9f5m\xa1\xa4\xb5\xf1\x87\x8d\xf5}2yte\x14V\xf6\x10\xae\xd4\xeec\xa0\xdaq@(\xd6B\xa8R\xee"v\xf3\xeef\xb7\xb1\x8a\x8cu|\x11J\xb0 \xbe\xe1\x0e\rg\xc3\x9dd\xe2\xb12\xaf\xa3T\xa9\x18\xe7\xf3\x14V\x90\x07\xfali\x91\xc8\x06\xb3\xad\xe0i@\x19"W\x19\x1b\xc9|\xca\xfb\xe1x\xa8\xe4\xd8\x19\x81u4%\xc4_\xfb\xe9\xf90fI\x0eo\x9b\x1d\x98\x13\xa9\xd5\x89\x8c\xab>\xafH\xa2\x91eVe\xea\x03\x19p\xab\xa5\xed\x06\xb9f\x80\xc60\xc0\x8b\x1c\x18\xec\xd3\xb2\xc6l\xe44TAs3\x15\xc4\xac\xac\x0c\x0baN\xcb\xb7\x17\xd9\x1a\xbeG\x88\x9b\x98R\xb0Tp\x04\xa8\x99\x86\x11\xd5_I\x07\xce\x0e\xb8\x92\'Y\xefV\xc287\xdb+\xfd\xd2D\x13\xf7\x84\xec\xd45\x19R\x16O\xa1\x119<2\xb9\xa0K\xf6G\x8e\xc6S\n\r*h\xb1\xd1p\x10\xdd\\\xa9\xd0y\x1cG\x95\xb3D\xba\xa16\xb0\xd1\x98E\x87\x08\x01l.J\xe8\xeaA\x11\xb4Yr@\x19d!\xbb\x91\x06\xf1\x8a\xc0\xcdK\xf9\xback\x14\xa8F\x99)\x9f\xe5\xaf\xce#}ITF\x131T\xab\xe0\x05*>\xbeA{>\xac\xeak\xea\x95\xf9Bw 4\xec\xac\xdc\xe8\xac\xe4\xb6v\xcd\x91\x95\x05'

def main(request, response):
    if b'raw' in request.GET:
        headers = [(b"Content-type", b"text/plain"),
                   (b"Content-Length", len(decoded))]
        return headers, decoded

    headers = [(b"Content-type", b"text/plain"),
               (b"Content-Encoding", b"br"),
               (b"Content-Length", len(encoded))]
    return headers, encoded
